import os
from Base.ConstPool import ServerIP, ServerPort

# 本地资源目录
BaseDIR = os.path.dirname(os.path.dirname(__file__))
TestCaseDIR = os.path.join(BaseDIR, 'TestCase' + os.sep)
TestDataDIR = os.path.join(BaseDIR, 'TestData' + os.sep)

# 服务端入口文件
EntranceDIR = os.path.join(BaseDIR, 'Entrance' + os.sep)
StaticDIR = os.path.join(EntranceDIR, 'static' + os.sep)
TemplatesDIR = os.path.join(EntranceDIR, 'templates' + os.sep)
ReportDIR = os.path.join(StaticDIR, 'Report' + os.sep)
SuiteReport = os.path.join(StaticDIR, 'SuiteReport' + os.sep)
LogsDIR = os.path.join(StaticDIR, 'Logs' + os.sep)
PictureDIR = os.path.join(StaticDIR, 'Picture' + os.sep)

# 图片文件夹
PictureCommonDIR = os.path.join(PictureDIR, 'common' + os.sep)
PictureBaiduDIR = os.path.join(PictureDIR, 'baidu' + os.sep)

# 服务端配置信息
ServePath = f"http://{ServerIP}:{ServerPort}/"
ServeStaticPath = f"{ServePath}static/"
ServeReportDIR = f"{ServeStaticPath}Report/"
ServeLogsDIR = f"{ServeStaticPath}Logs/"
ServeSuiteReport = f"{ServeStaticPath}SuiteReport/"
AirtestResourceDIR = f"{ServeStaticPath}AirtestResource/"

if __name__ == '__main__':
    str1 = r"D:\\develop\\workspace\\PyWork\\sdk_ui_test\\TestData\\Picture\\tpl1703735171109.png"
    newBaseDIR = rf"{BaseDIR}".replace("\\", "\\\\")
    print(str1.replace(newBaseDIR, ServePath))
